package com.wk.mui_demo.controller;

import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestHeader;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;

import java.util.HashMap;
import java.util.Map;

@Controller
public class UserController {
    @PostMapping("/test")
    public String test (@RequestParam Map<String, Object> params) {
        System.out.println(params.get("username"));

        return "test返回";
    }

    @RequestMapping("/test2")
    public Object test2(@RequestHeader Map<String, String> map){
        System.out.println(map.toString());
        return map.toString();
    }
}
